#include "processpool.hpp"
#include "task.hpp"

void Usage(std::string proc)
{
    std::cout<<"Usage: "<<"processpool-num"<<std::endl;
}
int main(int argc, char *argv[])
{
    //判断用户参数
    if (argc != 2)
    {
        Usage(argv[0]);
        return UsageError;
    }
    int num = std::stoi(argv[1]);

    processpool* pp = new processpool(num,worker);

    pp->InitProcessPool();
    //pp->DebugPrint();
    pp->Dispatchtask();
    pp->Cleanprocesspool();

    delete pp;

    return 0; 


}